using Xtensive.Orm;
using Xtensive.Orm.Model;

namespace SalesPoint.Model
{
  [TableMapping("Products")]
  [HierarchyRoot(InheritanceSchema.SingleTable)]
  [Index("Category", "Supplier", "UnitPrice")]
  public class Product : Entity
  {
    [Field, FieldMapping("ProductId"), Key]
    public int Id { get; private set; }

    [Field(Length = 40, Indexed = true)]
    public string ProductName { get; set; }

    [Field, FieldMapping("Seller")]
    public Supplier Supplier { get; set; }

    [Field]
    public Category Category { get; set; }

    [Field]
    public ProductType ProductType { get; set;}

    [Field(Indexed = true)]
    public decimal UnitPrice { get; set; }

    [Field]
    public short UnitsInStock { get; set; }

    [Field]
    public short UnitsOnOrder { get; set; }

    [Field]
    public short ReorderLevel { get; set; }

    [Field(Length = 20)]
    public string QuantityPerUnit { get; set; }

    public Product(Session session)
      : base(session)
    {
    }
  }
}